<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script type="text/javascript" src="<?php echo Yii::app()->baseUrl ?>/assets/js/jquery-1.7.2.min.js"></script>
        <script type="text/javascript" src="<?php echo Yii::app()->baseUrl ?>/assets/js/jquery-ui-1.10.3.min.js"></script>
        
        <!--elFinder CSS (REQUIRED)--> 
        <link rel="stylesheet" type="text/css" media="screen" href="<?php echo Yii::app()->baseUrl ?>/css/elfinder.min.css">
        <link rel="stylesheet" type="text/css" media="screen" href="<?php echo Yii::app()->baseUrl ?>/css/theme.css">
        
        <!--elFinder JS (REQUIRED)--> 
        <script type="text/javascript" src="<?php echo Yii::app()->baseUrl ?>/js/elfinder.min.js"></script>
        
        <!--elFinder translation (OPTIONAL)--> 
       <!--<script type="text/javascript" src="<?php echo Yii::app()->baseUrl ?>/js/i18n/elfinder.ru.js"></script>-->
        
        <!--elFinder initialization (REQUIRED)--> 
        <script type="text/javascript" charset="utf-8">
            $().ready(function() {
            });
        </script>
        <title></title>
    </head>
    <body>
        <div id="main-container" class="main-container">
            <div id="breadcrumbs" class="breadcrumbs">
                
                <script type="text/javascript">
                    try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){};
                </script>
                
                <ul class="breadcrumb">
                    <li>
                        <i class="icon-home home-icon"></i>
                        <a href="../site/index"><strong>Trang Chủ</strong></a>
                    </li>
                    
                    <li>
                        <a href="../site/store"><strong> Cửa Hàng</strong></a>
                    </li>
                    
                    <li>
                        <strong> Thêm Cửa Hàng</strong>
                    </li>
                </ul><!-- .breadcrumb -->
                
                <div id="nav-search" class="nav-search">
                    <form class="form-search">
                        <span class="input-icon">
                            <input type="text" autocomplete="off" id="nav-search-input" class="nav-search-input" placeholder="Search ...">
                            <i class="icon-search nav-search-icon"></i>
                        </span>
                    </form>
                </div><!-- #nav-search -->
            </div>    
            
            <div class="page-content">
                <div class="page-header">
                    <h1><strong>Thêm Cửa Hàng</strong></h1>
                </div><!-- /.page-header -->
                <div class="row">
                    <div class="col-xs-12">
            <?php $form=$this->beginWidget('CActiveForm', array(
                'htmlOptions' => array(
                    'enctype' => 'multipart/form-data',
                ),              
            ));?>
                        <!--<form class="form-horizontal" method="POST" enctype="multipart/form-data">-->
                        <fieldset>
                            <div class="form-group">
                        <?php // echo $form->error($model,'name');?>
                                <label class="col-sm-2 control-label no-padding-right">
                                    Tên cửa hàng
                                </label>
                                <div class="col-sm-10">
                                    <input class="col-xs-10 col-sm-5" type="text" name="StoreForm[name]" id="StoreForm_name" value="Cửa hàng mới"></input>
                                </div>
                            </div>
                            <div class="clearfix"></div>
                            <div class="space-6"></div>
                            
                            <div class="form-group">
                        <?php // echo $form->error($model,'mobile');?>
                                <label class="col-sm-2 control-label no-padding-right">
                                    Số điện thoại
                                </label>
                                <div class="col-sm-10">
                                    <input class="col-xs-10 col-sm-5" type="text" name="StoreForm[mobile]" id="StoreForm_mobile"></input>
                                </div>
                            </div>
                            <div class="clearfix"></div>
                            <div class="space-6"></div>
                            
                            <div class="form-group">
                        <?php // echo $form->error($model,'adress');?>
                                <label class="col-sm-2 control-label no-padding-right">
                                    Địa chỉ
                                </label>
                                <div class="col-sm-10">
                                    <input class="col-xs-10 col-sm-5" type="text" name="StoreForm[address]" id="StoreForm_address"></input>
                                </div>
                            </div>
                            <div class="clearfix"></div>
                            <div class="space-6"></div>
                            
                            <div class="form-group">
                        <?php // echo $form->error($model,'lat');?>
                                <label class="col-sm-2 control-label no-padding-right">
                                    Latitue
                                </label>
                                <div class="col-sm-10">
                                    <input class="col-xs-10 col-sm-5" type="text" name="StoreForm[lat]" id="StoreForm_lat"></input>
                                </div>
                            </div>
                            <div class="clearfix"></div>
                            <div class="space-6"></div>
                            
                            <div class="form-group">
                        <?php // echo $form->error($model,'lng');?>
                                <label class="col-sm-2 control-label no-padding-right">
                                    Longtitue
                                </label>
                                <div class="col-sm-10">
                                    <input class="col-xs-10 col-sm-5" type="text" name="StoreForm[lng]" id="StoreForm_lng"></input>
                                </div>
                            </div>
                            <div class="clearfix"></div>
                            <div class="space-6"></div>
                            
                            <div class="form-group"> 
                                <label class="col-sm-2 control-label no-padding-right">
                                    Ảnh
                                </label>
                                <div class="col-sm-10" >
                            <?php // echo CHtml::activeFileField($model, 'image'); ?>
                                    <img src="../../images/photo.png" onclick="imageClick();" id="LinkImage" name="LinkImage" style="max-height: 600px; max-width: 800px;"/>
                                    <input type="hidden" id="StoreForm_image" name="StoreForm[image]" type="text"/>
                                    <p class="help-block">                                
                                        Image must be more than 100x100px and smaller than 4MB
                                    </p>
                                </div>
                            </div>
                            
                            <div class="clearfix"></div>
                            <div class="clearfix form-actions">
                                <div class="col-md-offset-2 col-md-10">
                                    <button class="btn btn-sm btn-primary" type="submit" name="submit" value="submit">
                                        <i class="icon-save align-top bigger-125"></i>
                                        Save
                                    </button>
                                    <a class="btn btn-sm" type="button" href="../site/store">
                                        Back
                                        <i class="icon-backward align-top bigger-125"></i>
                                    </a>
                                </div>
                            </div>
                        </fieldset>
                        <!--</form>-->
            <?php $this->endWidget(); ?>
                    </div>
                </div>
                
            </div>
        </div>
        <script type="text/javascript" charset="utf-8">
            function imageClick(){
                $( "#dialog-message" ).dialog({
                    title:"",
                    height:600,
                    width:1100,
                    modal: true
                });					
                var elf = $('#elfinder').elfinder({
                    url : '<?php echo Yii::app()->baseUrl ?>/php/connector.php' // connector URL (REQUIRED)
                    ,lang: 'en',
                    width:'100%',
                    commandsOptions: {
                        getfile: {
                            oncomplete: 'destroy' 
                        }
                    },
                    getFileCallback: function(file) {
                        $('#LinkImage').attr('src',file);
                        //                       $('#CategoryForm_image').attr('value',file);
                        //                            $('#CategoryForm_image').attr('src',file);
                        $('#StoreForm_image').attr('value',file);
                        $( "#dialog-message" ).dialog( "close" );
                    }
                }).elfinder('instance');
            };            
        </script>
        <div id="dialog-message" >
            <div id="elfinder"></div>
        </div>
    </body>
</html>
